package com.example.demo.controller;

import com.example.demo.service.PmWorkCardService;
import com.example.demo.vo.Response;
import com.example.demo.vo.WorkCardReqVO;
import com.example.demo.vo.WorkHistroyRespVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/immp/workCard")
@RestController
public class PmWorkCardController {

    @Autowired
    private PmWorkCardService pmWorkCardService;

    /**
     * 历史工单查询
     *
     * @param workCardDTO 查询参数
     * @return 列表
     */
    @PostMapping(value = "/getWorkCardHistoryList")
    public Response<WorkHistroyRespVO> getWorkCardHistoryList(@RequestBody WorkCardReqVO workCardDTO) {
        long start = System.currentTimeMillis();
        WorkHistroyRespVO workHistroyRespVO = pmWorkCardService.getWorkCardHistoryList(workCardDTO);
        workHistroyRespVO.setTime(System.currentTimeMillis() - start);
        return Response.data(workHistroyRespVO);
    }

}
